import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import ConTainer from '@/views/container'
Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/home' },

  {
    path: '/home',
    component: Layout,
    children: [
      {
        path: '/home',
        component: () => import('@/views/home'),
        // 这里因为加了路由重订项 所配置路由信息只能写在子级中
        meta: {
          showGoTop: true,
          showFooter: true,
          showTopRoof: false,
          search: true,
          ordercenter: true
        },
      }
    ]
  },
  {
    path: '/ordercenter',
    component: Layout,
    name: "ordercenter",
    children: [
      {
        path: '',
        component: () => import('@/views/ordercenter'),
        meta: {
          showGoTop: true,
          showFooter: true,
          showTopRoof: false,
          search: false,
          ordercenter: false
        },
      }
    ]
  },
  {
    path: '/ordertime',
    component: Layout,
    name: "ordertime",
    children: [
      {
        path: '',
        component: () => import('@/views/ordertime'),
        meta: {
          showGoTop: true,
          showFooter: true,
          search: false,
          ordercenter: true
        },
      }
    ]
  },
  {
    path: '/commodity/:id/:name',
    component: Layout,
    name: "commodity",
    children: [
      {
        path: '',
        component: () => import('@/views/commodity'),
        meta: {
          showGoTop: false,
          showFooter: false,
          showTopRoof: false,
          search: false,//搜索框
          ordercenter: false//订单中心
        },
      }
    ]
  },
  {
    path: '/capitalsourcestoreshop',
    component: Layout,
    name: "capitalsourcestoreshop",
    children: [
      {
        path: '',
        component: () => import('@/views/capitalsourcestoreshop'),
        meta: {
          showGoTop: true,
          showFooter: true,
          showTopRoof: true,
          search: true,
          ordercenter: true
        },
      }
    ]
  },
  {
    path: '/Fundproductmanagement',
    component: Layout,
    name: "Fundproductmanagement",
    children: [
      {
        path: '',
        component: () => import('@/views/Fundproductmanagement'),
        meta: {
          showGoTop: true,
          showFooter: false,
          showTopRoof: false,
          search: false,
          ordercenter: false,
          location: "-180px"//控制电子商城log的位置
        },
      }
    ]
  },
  {
    path: "/attribute",
    component: Layout,
    name: "attribute",
    children: [
      {
        path: '',
        component: () => import('@/views/attribute'),
        meta: {
          showGoTop: true,
          showFooter: false,
          showTopRoof: false,
          search: false,
          ordercenter: false,
          location: "-90px"//控制电子商城log的位置
        },
      }
    ]
  },
  {
    path: "/Productadditiondetails",
    component: Layout,
    name: "Productadditiondetails",
    children: [
      {
        path: '',
        component: () => import('@/views/Productadditiondetails'),
        meta: {
          showGoTop: true,
          showFooter: false,
          showTopRoof: false,
          search: false,
          ordercenter: false,
          location: "-130px"//控制电子商城log的位置
        },
      }
    ]
  },
  // 类似后台的路由
  {
    path: "/ConTainer",
    component: ConTainer,
    name: "运营分析",
    iconClass: "el-icon-odometer",
  },
  {
    path: "/ConTainer/essential",
    component: ConTainer,
    name: "基础数据",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "基础数据"
    },
    children: [
      {
        path: '/ConTainer/essential',
        name: "基础数据",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/essential'),
        meta: {
          title: "基础数据"
        },
      },
    ]
  },
  {
    path: "/ConTainer/Itemstobeapproved",
    component: ConTainer,
    name: "待审批事项",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "待审批事项"
    },
    children: [
      {
        path: '/ConTainer/Itemstobeapproved',
        name: "待审批事项",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/Itemstobeapproved'),
        meta: {
          title: "待审批事项",
        }
      },
    ]
  },
  {
    path: "/ConTainer/shop",
    component: ConTainer,
    name: "店铺管理",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "店铺管理"
    },
    children: [
      {
        path: '/ConTainer/shop',
        name: "店铺管理",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/shop'),
        meta: {
          title: "店铺管理",
        }
      },
    ]
  },
  {
    path: "/ConTainer/productlist",
    component: ConTainer,
    name: "商品管理",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "商品管理"
    },
    children: [
      {
        path: '/ConTainer/productlist',
        name: "属性定义",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/productlist'),
        meta: {
          title: "属性定义"
        }
      },
      {
        path: '/ConTainer/stencil',
        name: "规格模板",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/productlist/components/stencil'),
        meta: {
          title: "规格模板"
        }
      },
      {
        path: '/ConTainer/listbox',
        name: "商品列表",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/productlist/components/listbox'),
        meta: {
          title: "商品列表"
        }
      },
    ]
  },
  {
    path: "/ConTainer/setup",
    component: ConTainer,
    name: "高级设置",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "高级设置"
    },
    children: [
      {
        path: '/ConTainer/setup',
        name: "高级设置",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/setup'),
        meta: {
          title: "高级设置"
        }
      },
    ]
  },
  {
    path: "/ConTainer/system",
    component: ConTainer,
    name: "系统管理",
    iconClass: "el-icon-ice-cream-square",
    meta: { title: "系统管理" },
    children: [
      {
        path: '/ConTainer/system',
        name: "系统管理",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/system'),
        meta: {
          title: "系统管理"
        }
      },
    ]
  },
  {
    path: "/ConTainer/management",
    component: ConTainer,
    name: "结算管理",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "结算管理"
    },
    children: [
      {
        path: '/ConTainer/management',
        name: "结算管理",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/management'),
        meta: {
          title: "结算管理"
        }
      },
    ]
  },
  {
    path: "/ConTainer/integrator",
    component: ConTainer,
    name: "系统集成设置",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "系统集成设置"
    },
    children: [
      {
        path: '/ConTainer/integrator',
        name: "系统集成设置",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/integrator'),
        meta: {
          title: "系统集成设置"
        }
      },
    ]
  },
  {
    path: "/ConTainer/analysis",
    component: ConTainer,
    name: "统计分析",
    iconClass: "el-icon-ice-cream-square",
    meta: {
      title: "统计分析"
    },
    children: [
      {
        path: '/ConTainer/analysis',
        name: "资金订单查询",
        iconClass: "el-icon-ice-cream-square",
        component: () => import('@/views/analysis'),
        meta: {
          title: "资金订单查询"
        }
      },
    ]
  },
  {
    path: "/ConTainer/Orderdetailsone",
    component: ConTainer,
    name: "订单管理",
    meta: {
      title: "订单管理"
    },
    children: [
      {
        path: '',
        name: "订单管理",
        component: () => import('@/views/Orderdetailsone'),
        meta: {
          title: "订单管理"
        }
      },
    ]
  },
  {
    path: "/ConTainer/Orderdetails",
    component: ConTainer,
    name: "订单详情",
    meta: {
      title: "订单详情"
    },
    children: [
      {
        path: '',
        name: "订单详情",
        component: () => import('@/views/Orderdetails'),
        meta: {
          title: "订单详情"
        }
      },
    ]
  },

  {
    path: '*',//404报错
    component: () => import('@/views/404'),
    name: '404',

  }
]


const router = new VueRouter({
  // mode: "history",//路由模式改变
  routes
})
// const router = createRouter({

//   routes
// })
export default router
